<html>
    <head>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url("public/admin/css/style.css"); ?>">
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
        </script>
        <script type="text/javascript">
            $(document).ready(function() {
                var count = 0;
                $("#add h2").click(function() {
                    $("#add table").fadeToggle();
                    if (count % 2 != 0)
                        $(".img_an_hien").attr('src', '<?php echo base_url("public/admin/images/sq_plus_icon&24.png") ?>');
                    else
                        $(".img_an_hien").attr('src', '<?php echo base_url("public/admin/images/sq_minus_icon&24.png"); ?>');
                    count++;

                });
            });
        </script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>List of company</title>
    </head>
    <body>
        <div id="wraper">
            <?php $this->load->view('admin/menu', array('action' => $action)); ?>
            <div id="content">
                <?php $this->load->view('admin/forms/companies_form'); ?>
                <div class="total_pagination">
                    <div id="show_search" class="float_left">
                        <b>Total :&nbsp; </b>
                        About <?php echo $total_companies; ?> result.
                    </div>
                    <div id="pagination" class="float_right">
                        <?php echo 'pagination'; ?>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="show_data">
                    <table cellspacing="0" cellpadding="5" border="0" width="100%">
                        <tr>
                            <td align="center" colspan="10" valign="middle" class="title" style="padding: 15px;">Companies</td>
                        </tr>
                        <tr>
                            <td class="title com_name">Name</td>
                            <td class="title com_address">Website</td>
                            <td class="title com_profile">Email</td>          
                            <td class="title com_operation">Operation</td>            
                        </tr>
                        <?php if (!empty($companies)): ?>
                            <?php foreach ($companies as $item): ?>
                                <tr>
                                    <td class="show_name com_name" style="width: 250px"><?php echo $item["name"]; ?></td>
                                    <td class="com_address"><?php echo $item["website"]; ?></td>
                                    <td class="com_profile" style="width: 450px;"><?php echo $item["email"]; ?></td>
                                    <td class="com_profile" style="width: 450px;"><?php echo $item["description"]; ?></td>
                                    <td class="infor_show com_operation" style="width:60px"> 
                                        <a href="edit_works.php?id=<?php echo $item["id"]; ?>" class="edit" title="edit works">Edit</a> 
                                        <a href="delete_works.php?id=<?php echo $item["id"]; ?>" class="delete" title="delete company">Delete</a>
                                    </td>   
                                </tr>
                            <?php endforeach; ?>
                        <?php else : ?>
                            <div class='notice'>Not find companies</div>
                        <?php endif; ?>
                    </table>
                </div><!-- End: #show_work -->
            </div><!--End: #content-->
        </div><!-- end #wraper -->
    </body>
</html>